#ifndef MESSAGESYSTEM_H
#define MESSAGESYSTEM_H
#include "MessageGroup.h"
#include "ProcessMessage.h"
#include "StompedReality/Core.h"
#include "StompedReality/Core/GameAccess.h"
#include "StompedReality/Core/IGame.h"
#include "StompedReality/Core/Memory/ObjectPoolManager.h"
#include <vector>
namespace StompedReality
{
namespace Core
{
/*!
 * \author	Stefan Kazalski
 *
 * \brief	Message System.
 *
 *    Sends messages to groups.
 */
class DLL_EXPORT MessageSystem : public StompedReality::GameAccess
{
 private:

  typedef std::vector<StompedReality::Core::MessageGroup* > MessageGroupVector;
  MessageGroupVector _msgGroups;

 public:

  //! \brief	Constructor.
  MessageSystem( );

  //! \brief	Destructor.
  virtual ~MessageSystem( );

  //! \brief	Reads groups from file.
  //! \param	fileName	The file.
  //! \return Success.
  bool ReadFromFile ( const char* fileName );

  //! \brief	Sends message to all recievers.
  //! \param	msg		The message.
  //!	\return	Success.
  bool sendToAll ( Message* msg );

  StompedReality::Core::MessageGroup* GetGroup( StompedReality::ID id );
};

}
}
#endif // MESSAGESYSTEM_H
